package ch6;

public class Printer {
	private String series;
	private int money;

	private Ink ink;// 自带了墨水接口
	private Paper paper;// 自带了纸张接口

	public Printer(String series, int money) {
		super();
		this.series = series;
		this.money = money;
	}

	// 接入墨盒和纸张的方法
	public void setInk(Ink i) {
		ink = i;
	}

	public void setPaper(Paper p) {
		paper = p;
	}

	public void printDoc(String s) {
		System.out.println("用" + ink.getColor() + "在打印");

		paper.print(s);
	}

	public void show() {
		System.out.println("这是" + series + "打印机，价格是" + money + "元");
	}
}
